package com.example.sqlitetest;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity
public class AlarmData {

    //自增主键
    @PrimaryKey(autoGenerate = true)
    private int id;

    //报警代码
    @ColumnInfo(name = "alarm_number")
    private int alarmNumber;

    //报警值 0:正常  1:报警
    @ColumnInfo(name = "alarm_value")
    private int alarmValue;

    //时间戳也是开始报警时间
    @ColumnInfo(name = "time_start")
    private long timeStart = System.currentTimeMillis()/1000;

    public AlarmData(int alarmNumber,int alarmValue){
        this.alarmNumber = alarmNumber;
        this.alarmValue = alarmValue;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAlarmNumber() {
        return alarmNumber;
    }

    public void setAlarmNumber(int alarmNumber) {
        this.alarmNumber = alarmNumber;
    }

    public int getAlarmValue() {
        return alarmValue;
    }

    public void setAlarmValue(int alarmValue) {
        this.alarmValue = alarmValue;
    }

    public long getTimeStart() {
        return timeStart;
    }

    public void setTimeStart(long timeStart) {
        this.timeStart = timeStart;
    }
}
